/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) 李文友 2017.5.8 类的具体实现代码编写

 ***************************************************************************
 *  @file x.h
 *  功能:
 *
 *                                                                         *
 ***************************************************************************/
#ifndef ENUM_H
#define ENUM_H

#include <QDataStream>
#include <QtCore/qmath.h>

#define MAC_UNEQUAL  3000
#define TIME_PASSED 5000
#define TIME_NORMAL 6000
#define TIME_GOING_PASSED   5500
#define REGISTER_NO_EXIST 4000

#define D_THE_LAST_LINE -1

#define CHANGE_NUM 10000
#define COMMAND_ERROR -1000
#define MICROSECOND_TIME 1000000.0
#define OVER_FLOW_MAX_TIME 2147483.647

#define END_FLAG 20

#define TRYLOCKTIME 1000

#define D_PROGRAM_ENGINE_SLEEP_TIME 3000
#define D_PROGRAM_ENGINE_SLEEP_FREQUENCY 100
#define D_MOTION_INSTRUCTION_WAIT_SLEEP 9800

#define D_MAX_CALL_PROGRAM_NUMBER 20

#define DEGTOMM     1.111
#define MMTODEG     20

#define PORT 5080

#define SLOWRATE 0.01

#define ZEROMAX 0.00000001
#define ZEROMIN -0.00000001

#define SMOOTH_VALUE 2000
#define CIRCLE_VALUE 2000
#define REG_SIZE    200
#define PL_SIZE     100

#define AR_SIZE     10
#define TIMER_SIZE  200

#define SEGMENT 1000
#define FORWARD     1
#define BACKWARD    -1
#define MAXLINE     500
#define DEFAULT_POINT_SIZE  150
#define DEFAULT_AXIS_COUNT  6

#define PI_MOTION   3.141593
#define DEG         180

#define MAX_TARGETPOS_QUEUE 5000000

#define PL_REGISTER_FILE    "./data/datFile/pl_register.dat"
#define PR_REGISTER_FILE    "./data/datFile/pr_register.dat"
#define R_REGISTER_FILE "./data/datFile/r_register.dat"
#define ZERO_FILE       "./data/datFile/zeroInfo.dat"
#define REG_FILE        "./data/datFile/register.dat"
#define SERIAL_FILE     "./data/datFile/serialNum.dat"
#define PROINFOFILE     "./data/datFile/programInfo.dat"
#define RECORD_DAILY_FILE   "./data/datFile/record.dat"

#define AUTOFILEPATH    "./data/program/"

#define FILEINFONAME    "fileInfo.ini"
#define POSINFONAME     "positionInfo.ini"

#define SETTING_FILE    "./data/config/Setting.xml"
#define IOMOTOR_FILE    "./data/config/Ecat.xml"
#define RECORD_FILE     "./data/config/recordDate.xml"

#define USERFRAME3_FILE "./data/frameFile/userFrame3.xml"
#define USERFRAME4_FILE "./data/frameFile/userFrame4.xml"
#define TOOLFRAME3_FILE "./data/frameFile/toolFrame3.xml"
#define TOOLFRAME4_FILE "./data/frameFile/toolFrame4.xml"

#define USERFRAME_FILE  "./data/frameFile/userFrame.dat"
#define TOOLFRAME_FILE  "./data/frameFile/toolFrame.dat"

#define CONFIG_PATH     "./data/config/"
#define CONFIG_SUFFORMAT    ".xml"


#define THREE_POINT_NUM  3
#define FOUR_POINT_NUM  4
#define SIX_POINT_NUM  6

#define T_PI  360.0
/**指令类型**/
//enum COMMAND_TYPE
//{
//    HOME_STATE,
//    IO_STATE,
//    SETTING_STATE,
//    INVERT_STEP_STATE,
//    ORDER_SERIES_STATE,
//    ORDER_STEP_STATE,
//    PAUSE_STATE,
//    STOP_STATE,
//    EMERGENCY_STOP_STATE,
//    SEND_PROGRAMSET,
//    READ_DATA,
//    READ_IO,
//    SCAN_LOG,
//    COMMON_CONSUMER,
//    ADMINISTRATOR,
//    SAVE_DATA_STATE,
//    REGISTER_FILE,
//    REGISTER_TO_SERVER,
//    SAVE_POINT,
//    AXIS_1_LEFT,
//    AXIS_1_RIGHT,
//    AXIS_2_LEFT,
//    AXIS_2_RIGHT,
//    AXIS_3_LEFT,
//    AXIS_3_RIGHT,
//    AXIS_4_LEFT,
//    AXIS_4_RIGHT,
//    LINE_1_LEFT,
//    LINE_1_RIGHT,
//    LINE_2_LEFT,
//    LINE_2_RIGHT,
//    LINE_3_LEFT,
//    LINE_3_RIGHT,
//    JOINT_1_LEFT,
//    JOINT_1_RIGHT,
//    JOINT_2_LEFT,
//    JOINT_2_RIGHT,
//    JOINT_3_LEFT,
//    JOINT_3_RIGHT,
//    JOINT_4_LEFT,
//    JOINT_4_RIGHT,
//    LINES_1_LEFT,
//    LINES_1_RIGHT,
//    LINES_2_LEFT,
//    LINES_2_RIGHT,
//    LINES_3_LEFT,
//    LINES_3_RIGHT,
//    SPEED_UP,
//    SPEED_DOWN,
//    MATXIS_DATA,
//    CURRENT_DATA,
//    READ_MATRIX,
//    AXIS_RELEASED,
//    RECV_OK,
//    HAND_MANUAL,
//    CURRENT_RATE,
//    IP_ADDRESS,
//    USER_PERMISSON,
//    NEW_FILE,
//    GET_PROGRAMLIST,
//    GET_CONFIGLIST,
//    OPEN_FILE,
//    DELETE_FILE,
//    EDIT_FILE,
//    COPY_FILE,
//    SET_AUTO_FILE,
//    GET_AUTO_FILE,
//    GET_CURRENT_STATE,
//    IMPORT_FILE,
//    EXPORT_FILE,
//    IMPORT_CONFIG_FILE,
//    EXPORT_CONFIG_FILE,
//    GET_POINT,
//    ZERO_MODEL,
//    HAND_TO_ZERO,
//    HAND_STATE,
//    COORDINATE_SWITCH,
//    GET_COORDINATE,
//    IO_AND_COORDINATE,
//    CURRENT_READ_HAND,
//    ZERO_CURRENT,
//    MOVE_TO_POINT,
//    EDIT_POINT,
//    GET_CONFIG_INFO,
//    SAVE_CONFIG_INFO,
//    HAND_SERIES_STATE,
//    SAVE_POINT_FLAG,
//    SAVE_SAFE_POINT,
//    RESET_ZERO_STATUS,
//    RESET_LIMIT_POINT,
//    RESET_AXIS_NUM,
//    SEND_PALLETIZING,
//    CLEAR_ALARM,
//    CHANGE_PWD,
//    SERIAL_NUM,
//    GET_SERIAL_STATUS,
//    GET_ALLALARM,
//    SERVO_ON,
//    SERVO_SWITCH,
//    GET_WARNING_STATUS,
//    UPDATE_DATA,
//    SEND_PRO_SPEED,
//    SEND_MAN_SPEED,
//    SET_ZERO_POS,
//    LINE_TO_POINT,
//    TYPE_POINT_SAVED,
//    UPDATE_COORDINATE_DATA,
//    MOVE_TO_COORDINATE_POINT,
//    CHANGE_SAVE_POINT_TYPE,
//    GET_NEW_POINT,
//    SAVE_PALLETIZING_POINT,
//    COORDINATE_ACTIVE,
//    CHECK_R_VALUE,
//    SAVE_R_VALUE,
//    CHECK_PR_VALUE,
//    SAVE_PR_VALUE,
//    CHECK_PL_VALUE,
//    SAVE_PL_VALUE,
//    START_TYPE,
//    REG_CLEAR,
//    POWER_OFF,
//    GET_CONTROL_VERSION,
//    UPDATE_CONTROL_VERSION,
//    GET_BACKUP_FILE,
//    SEND_RESTORE_FILE,
//    RESET_SOFT_LIMIT_FLAG,
//    OPEN_FILE_ERR,
//    RESTORE_FACTORY,
//    MOVE_TO_PALLET_POINT
//};

enum ENUM_GRIPPPER_TYPE
{
    ENUM_GRIPPER_ACTIVE,
    ENUM_GRIPPER_SET,
    ENUM_GRIPPER_WAIT,
    ENUM_GRIPPER_END
};

enum ENUM_ALARM_TYPE
{
    // 以下警告发送控制器清除TCP_ABORT警告除外
    EM_EAT_NONE,
    EM_EAT_EMERGENCY,
    EM_EAT_SER_WARNING,
    EM_EAT_POSITION_OFFSET,
    EM_EAT_STAMP_WARNING,
    EM_EAT_SOFT_LIMIT,

    EM_EAT_SERVON_BACK,   //伺服使能反馈异常
    EM_EAT_HARDWAVE_LIMIT,//硬限位报警
    EM_EAT_ENCODE_BACK,   //编码器反馈异常
    EM_EAT_READ_ENCODE_FAILD, //编码器读取失败
    EM_EAT_SYSTEM_EXPTION, //系统异常


    EM_EAT_CONTROL_VOLT_SHORT_PRO,  //控制电源不足电压保护
    EM_EAT_OVER_VOLT_PRO,           //过电压保护
    EM_EAT_MAIN_VOLT_SHORT_PN_PRO,  //主电源不足电压保护 PN键
    EM_EAT_MIAN_VOLT_SHORT_AC_PRO,  //主电源不足电压保护（ac关闭检出）
    EM_EAT_OVER_CURRENT_PRO,        //过电流保护
    EM_EAT_IPM_ERR_PRO,             //ipmError()异常保护
    EM_EAT_OVER_TEMP_PRO,           //过热保护
    EM_EAT_OVER_LOAD_PRO,           //过载保护
    EM_EAT_TOR_ERR_PRO,             //转矩保护异常保护#include "enum.h"
    EM_EAT_REG_OVER_LOAD_PRO,       //回生过负载保护
    EM_EAT_REG_TR_ERR_PRO,          //回生Tr异常保护
    EM_EAT_ENCODE_COMMU_BREAK,      //编码器通信短线异常保护
    EM_EAT_ENCODE_COMMU_ERR_PRO,    //编码器通信异常保护
    EM_EAT_ENCODE_COMMU_DATA_ERR,   //编码器通信数据异常保护
    EM_EAT_POS_OFFSET_BEYOND,       //位置偏差过大保护
    EM_EAT_SPEED_OFFSET_BEYOND,     //速度偏差过大
    EM_EAT_OVER_SPEED_PRO,          //过速度保护
    EM_EAT_OVER_SPEED_PRO2,         //第二过速度保护
    EM_EAT_ABS_CLEAR_PRO,           //绝对式清零保护
    EM_EAT_INSTRUCT_ERR_PRO,        //指令异常保护
    EM_EAT_ACTION_COMPET_PRO,       //动作指令竞争保护
    EM_EAT_POS_INIT_ERR_PRO,        //位置信息初始化异常保护
    EM_EAT_COUNT_OUT_PRO2,          //计数器溢出保护2
    EM_EAT_MOTOR_RANGE_ERR,         //电机可移动范围异常保护
    EM_EAT_SINGLE_ABS_RANGE_ERR,    //单圈绝对式可移动范围异常保护
    EM_EAT_EEPROM_ERR1,             //eeprom参数保护异常1
    EM_EAT_EEPROM_ERR2,             //eeprom参数保护异常2
    EM_EAT_EEPROM_ERR3,             //eeprom参数保护异常3
    EM_EAT_ABS_SYSTEM_CLOSE_PRO,    //绝对式系统关闭保护
    EM_EAT_ABS_OVER_SPEED_PRO,      //绝对式过速保护
    EM_EAT_ABS_RE_COUNT_ERR_PRO,    //绝对式1回转计数异常保护
    EM_EAT_ABS_MU_RE_COUNT_ERR_PRO, //绝对式多回转计数异常保护
    EM_EAT_ABS_STATUS_ERR_PRO,      //绝对式状态异常保护
    EM_EAT_INCRE_ENCODE_Z_ERR_PRO,  //增量式编码器Z相异常保护
    EM_EAT_INCRE_ENCODE_CS_ERR_PRO, //增量式编码器CS相异常保护
    EM_EAT_INIT_ERR_PRO,            //同期建立初始化异常保护
    EM_EAT_FORCE_ALARM_INPUT_PRO,   //强制报警输入异常保护
    EM_EAT_COMMAND_ERR_PRO,         //命令异常保护
    EM_EAT_ENCODE_DATA_RE_ERR_PRO,  //编码器数据复原异常保护
    EM_EAT_PARAM_SET_ERR_PRO1,      //参数设定异常保护1
    EM_EAT_PARAM_SET_ERR_PRO2,      //参数设定异常保护2
    EM_EAT_PARAM_SET_ERR_PR05,      //参数设定异常保护5
    EM_EAT_ORIGRN_RE_ERR2,          //原点复位异常2
    EM_EAT_MOTOR_AUTO_RECO_ERR_PRO0,//电机自动识别异常保护0
    EM_EAT_MOTOR_AUTO_RECO_ERR_PRO1,//电机自动识别异常保护1
    EM_EAT_MOTOR_AUTO_RECO_ERR_PRO2,//电机自动识别异常保护2
    EM_EAT_MOTOR_AUTO_RECO_ERR_PRO3,//电机自动识别异常保护3
    EM_EAT_COMMU_IC_ERR,            //通信IC初始化异常

    EM_EAT_ERR_ESM_REQ_PRO,         //不正确的ESM要求异常保护
    EM_EAT_UNDEFINE_ESM_REQ_PRO,    //未定义ESM要求异常保护
    EM_EAT_GUID_STATUS_ERR_PRO,     //引导状态要求异常保护
    EM_EAT_UNDONE_PLL_ERR_PRO,      //PLL未完成异常保护
    EM_EAT_PDO_WATCHDOG_ERR_PRO,    //PDO看门狗异常保护
    EM_EAT_PLL_ERR_PRO,             //PLL异常保护
    EM_EAT_SYNC_SIG_ERR_PRO,        //同期信号异常保护
    EM_EAT_SYNC_CY_SET_ERR_PRO,     //同期周期设定异常保护
    EM_EAT_MAILBOX_SET_ERR_PRO,     //mailBox设定异常保护
    EM_EAT_PDO_WATCHDOG_SET_ERR_PRO,//PDO看门狗设定异常保护
    EM_EAT_DC_SET_ERR_PRO,          //DC设定异常保护
    EM_EAT_SM_SET_ERR_PRO,          //SM事件模式设定异常保护
    EM_EAT_SYNC_MANAG_SET_ERR_PRO,  //同步管理设定异常保护
    EM_EAT_TX_PDO_ALLOC_ERR_PRO,    //TXPDO分配异常保护
    EM_EAT_RX_PDO_ALLOC_ERR_PRO,    //RXPDO分配异常保护
    EM_EAT_LOST_LINK_ERR_PRO,       //Lost Link异常保护
    EM_EAT_SII_EEPROM_ERR_PRO,      //SII EEPROM异常保护
    EM_EAT_VOLT_LESS_ERR_PRO,       //主电源不足电压保护
    EM_EAT_CONTROL_SET_ERR_PRO,     //控制模式设定异常保护
    EM_EAT_ACTION_ESM_ERR_PRO,      //动作中ESM要求异常保护
    EM_EAT_ACTION_ABNORMAL_PRO,     //不正常动作异常保护

    EM_EAT_IPM_FAULT,               //IPM异常
    EM_EAT_IPM_OVER_TEMP,           //IPM过热
    EM_EAT_OVER_CURRENT_SW,         //SW过电流
    EM_EAT_CURRENT_ERR,             //电流漂移异常
    EM_EAT_OVER_CURRENT_HW,         //HW过电流
    EM_EAT_SERIES_OVER_LOAD,        //连续超载
    EM_EAT_DRIVER_OVER_TEMP,        //驱动器过热
    EM_EAT_REGEN_OVER_LOAD,         //再生超载
    EM_EAT_MOTOR_CABLE_OPEN,        //电机回路中断
    EM_EAT_SERIAL_ENCODE_ERR,       //串行编码器通信错误
    EM_EAT_ENCODE_CABLE_OPEN,       //编码器电缆断开
    EM_EAT_ENCODE_DATA_ERR,         //编码器数据错误
    EM_EAT_MOTOR_ID_SET_ERR,        //电机ID设置错误
    EM_EAT_UNDER_VOLT,              //低电压
    EM_EAT_OVER_VOLT,               //过电压
    EM_EAT_RS_POWER_FAIL,           //主电源异常
    EM_EAT_CONTROL_POWER_ERR,       //控制电源异常
    EM_EAT_OVER_SPEED_LIMIT,        //超速
    EM_EAT_POS_OFFSET_OVER,         //位置误差过大
    EM_EAT_OVER_PULSE_ERR,          //脉冲指令频率异常
    EM_EAT_PARAM_ERR,               //参数异常0
    EM_EAT_PARAM_OVER_RANGE,        //参数超出最大范围
    EM_EAT_ETH_COMMU_ERR1,          //ethercat通信异常1
    EM_EAT_ETH_COMMU_ERR2,          //ethercat通信异常2
    EM_EAT_ETH_COMMU_ERR3,          //ethercat通信异常3
    EM_EAT_FACTORY_ERR,             //出厂值发生问题
    EM_EAT_OUTPUT_POS_ERR,          //输出节点设置异常
    EM_EAT_LS_ABSOLUTE_CLOSE_PROT,  //绝对值保护
    EM_EAT_FOLLOW_ERROR,            //跟随误差超设定上限
    EM_EAT_COOR_ERROR,              //运动指令示教坐标系与当前坐标系不匹配
    EM_EAT_TEACH_POINT_ERR,

    EM_ETHERCA_COMM_ERR,           // ETHERCAT 控制器通信错误
    EM_ETHERCA_SDO_INIT_ERR,       // ETHERCAT sdo初始化错误
    EM_ETHERCA_SLAVE_ALIAS_ERR,    // ETHERCAT 从站别名不匹配
    EM_ETHERCA_SLAVE_CONFIG_ERR,   // ETHERCAT 从站初始化配置失败
    EM_ETHERCA_DOMAIN_STATE_ERR,   // ETHERCAT 域数据读写失败

    EM_EAT_SELECT_CMD_ERR,              //select指令错误

    EM_EAT_DAILY_DAY_ERR,               //保存设定保存日志日期的文件损坏,recordDate.xml
    EM_EAT_DAILY_RECORD_ERR,            //保存设备日志的文件损坏，record.dat
    EM_EAT_USERINFO_ERR,                //保存设备用户帐号和密码以及启动类型的文件 userInfo.xml
    EM_EAT_USERFRAME_ERR,               //保存user坐标系的文件        frameFile/userFrame.dat
    EM_EAT_TOOLFRAME_ERR,               //保存tool坐标系的文件        frameFile/toolFrame.dat
    EM_EAT_ETHERCAT_ERR,                //保存Ethercat配置信息的文件     Ecat.xml
    EM_EAT_ZEROFILE_ERR,                //保存零点位置的文件             zeroInfo.dat
    EM_EAT_R_REG_ERR,                   //保存R寄存器数据的文件          r_register.dat
    EM_EAT_PR_REG_ERR,                  //保存PR寄存器数据的文件         pr_register.dat
    EM_EAT_PL_REG_ERR,                  //保存PL寄存器数据的文件         pl_register.dat
    EM_EAT_SETTING_ERR,                //保存setting文件数据           Setting.xml
    EM_EAT_PROGRAMLIST_ERR,            //保存programList文件数据       programInfo.dat
    EM_EAT_SERIAL_ERR,                 //保存用户注册序列号的文件        serialNum.dat
    EM_EAT_CONFIG_ERR,                 //当前导出配置文件的数据         readConfigFile
    EM_EAT_USER_RGISTER_ERR,           //用户注册码信息                register.dat
    EM_EAT_READ_PROGRAM_ERR,           //当前的程序文件校验错误         readprogramFile
    EM_EAT_AUTO_FILE_ERR,              //autoFile文件校验码           fileInfo.ini



    // 本警告上层自行控制
    EM_EAT_TCP_ABORT,
    EM_EAT_MD5_G_CODE_CHECK_ERROR, // G代码md5校验错误
    EM_EAT_MD5_SYSTEM_CONFIG_CHECK_ERROR, // 配置文件md5校验错误
    EM_EAT_END
};

enum EM_ROBOT_RUNNING_TYPE
{
    EM_ROBOT_RUN,
    EM_ROBOT_STOP,
    EM_ROBOT_EMG_STOP,
    EM_ROBOT_RUNNING_END
};

enum WAIT_CONDITION_TYPE
{
    WAIT_CONDITION_R,
    WAIT_CONDITION_AO,
    WAIT_CONDITION_AI,
    WAIT_CONDITION_GO,
    WAIT_CONDITION_GI,
    WAIT_CONDITION_END
};

enum WAIT_R_OR_CONST_TYPE
{
    WAIT_REG_CONST,
    WAIT_REG_R,
    WAIT_REG_END
};


enum DIRECTION_TYPE
{
    EM_CF_LEFT,
    EM_CF_RIGHT,
    EM_CF_DIRECTION_END
};

enum SAVE_POS_TYPE
{
    EM_CF_DEG_TYPE,
    EM_CF_WORLD_TYPE,   
    EM_CF_ELSE_END
};

enum WORLD_POS_TYPE
{
    EM_CF_X,
    EM_CF_Y,
    EM_CF_Z,
    EM_CF_W,
    EM_CF_P,
    EM_CF_R,
    EM_CF_WORLD_POS_END
};

enum MOTOR_TYPE
{
    LSMOTOR_TYPE = 1,
    SXMOTOR_TYPE = 2,
    TDMOTOR_TYPE
};

enum SERVOMOTOR_STATE
{
    SWITCH_ON_DISABLED_STATE,
    READY_TO_SWITCH_ON_STATE,
    SWITCH_ON_STATE,
    OPERATION_ENABLED_STATE,
    QUICK_STOP_ACTIVE_STATE,
    FAULT_REACTION_ACTIVE_STATE,
    FAULT_STATE,
    WARNING_IS_OCCURRED_STATE
};

//enum SERVOMOTOR_CONTROL_CMD
//{
//    SHUTDOWN_CTLCMD,
//    SWITCHON_CTLCMD,
//    ENABLEOPERATION_CTLCMD,
//    DISABLE_VOLTAGE_CTLCMD,
//    QUICK_STOP_CTLCMD,
//    DISABLE_OPERATION_CTLCMD,
//    FAULT_RESET_CTLCMD
//};


//enum ENUM_HOME_INTERRUPT
//{
//    EM_HOME_RUN,
//    EM_HOME_STOP,
//    EM_HOME_EMERGENCY_STOP
//};

/**手动模式*/
enum ENUM_HAND_STATE
{
    EM_HAND_STEP,
    EM_HAND_SERIES,
    EM_HAND_END
};

/**坐标模式*/
enum ENUM_COORD_CHOOSE_FLAG
{
    EM_CCF_COORD_JOINT,
    EM_CCF_COORD_WORLD,
    EM_CCF_COORD_TOOL,
    EM_CCF_COORD_USER,
    EM_CCF_COORD_END
};


/**运行模式*/
enum ENUM_EXECTYPE_STATUS
{
    EM_EXECTYPE_T1,
    EM_EXECTYPE_T2,
    EM_EXECTYPE_AUT,
    EM_EXECTYPE_EXC,
    EM_EXECTYPE_END
};

/**运行状态*/
enum ENUM_PROGRAM_RUN_STATUS
{
    EM_PROGRAM_RUN_PAUSE,
    EM_PROGRAM_RUN_STOP,
    EM_PROGRAM_RUN_RUN,
    EM_PROGRAM_RUN_END
};

/**typ定义 绝对和相对*/
enum ENUM_MOTOR_CIRCLENUM
{
    EM_CIRCLENUM_ABSOLUTELY,
    EM_CIRCLENUM_RELATIVE,
    EM_CIRCLENUM_END
};

/**回零模式*/
enum ENUM_ORIGIN_STATUS
{
    EM_ORIGIN_STATUS_UNSTANDBY,
    EM_ORIGIN_STATUS_STANDBY,
    EM_ORIGIN_STATUS_END
};

enum ENUM_UPDATE_STATUS
{
    EM_UPDATE_STATUS_LV1,
    EM_UPDATE_STATUS_LV2,
    EM_UPDATE_STATUS_FAIL,
    EM_UPDATE_STATUS_END
};

/**密码校验结果*/
enum PWD_CHECK
{
    PWD_SUCCESS,
    PWD_ERROR,
};

/**用户权限*/
enum ENUM_USER_POWER
{
    EM_USER_POWER_GUEST,
    EM_USER_POWER_MANAGER,
    EM_USER_POWER_TCKJ,
    EM_USER_POWER_CUSTOM,
    EM_USER_POWER_END
};

/**按键状态*/
enum BTN_STATUS
{
    BTN_PRESSED = 100,
    BTN_RELEASED,
    BTN_NO_TOUCH
};

//十六个IO状态
enum IO_STATUS_TYPE
{
    ONE_ON,
    TWO_ON,
    THREE_ON,
    FOUR_ON,
    FIVE_ON,
    SIX_ON,
    SEVEN_ON,
    EIGHT_ON,
    NINE_ON,
    TEN_ON,
    ELEVEN_ON,
    TWELVE_ON,
    THIRTEEN_ON,
    FOURTEEN_ON,
    FIFTEEN_ON,
    SIXTEEN_ON
};

enum JOINT_STATUS
{
    JOINT_ZERO,
    JOINT_ONE,
    JOINT_TWO,
    JOINT_THREE,
    JOINT_FOUR,
    JOINT_FIVE,
    JOINT_SIX,
    JOINT_SENVEN
};

// 消息类型
enum ENUM_MESSAGE_TYPE
{
    EM_MT_ORIGIN_OK=1,      // 原点复位ok 消息
    EM_MT_IP_SET_OK,        // ip设置ok 消息
    EM_MT_REGISTER_OK,      // 注册成功
    EM_MT_STORE_FACTORY_SET,        //恢复出厂设置 消息
    EM_MT_MAC_SET_OK,              //MAC设置ok 消息
    EM_MT_ONLINE_ID_CHECK_OK,      //联机检测没有冲突 消息
    EM_MT_ONLINE_SET_IO_MODE_OK,   //联机测试IO模式OK 消息
    EM_MT_ZERO_CLIBER_OK,          //零点标定
    EM_MT_EZ_BACK_ZERO_CLEAR_OK,    //清除EZ回零数据
    EM_MT_EZ_READ_ABSOLUTE_ENCODE_OK,      //读取绝对式编码器值成功
    EM_MT_STACK_REG_SET_OK,            //码垛堆上点设置成功
    EM_MT_SINGLE_AXIS_BACK_ORIGIN1,    //上下轴回零完成！
    EM_MT_SINGLE_AXIS_BACK_ORIGIN2,    //摆臂轴回零完成！
    EM_MT_SINGLE_AXIS_BACK_ORIGIN3,    //前后轴回零完成！BACK_ZERO_CLEAR
    EM_MT_SINGLE_AXIS_BACK_ORIGIN4,    //旋转轴回零完成！
    EM_MT_SINGLE_AXIS_BACK_ORIGIN5,    //翻转轴回零完成！
    EM_MT_SINGLE_AXIS_BACK_ORIGIN6,    //第六轴回零完成！
    EM_MT_EXTERN_IO_HOLD_SIGNAL,       //外部输入HOLD开关有效
    EM_MT_EXTERN_IO_START_SIGNAL,      //外部输入解除开关有效

    EM_MT_PUNCHER_SAFE_SIGNAL_CHECK, //冲床安全开关抬起


    EM_MT_IP_SET_FAIL = 100,        // ip设置fail 消息
    EM_MT_ORIGIN_FAIL,      // 原点复位fail 消息
    EM_MT_RTC_INIT_ERROR,   // rtc 警告
    EM_MT_OPEN_FILE_FAILURE,        //打开文件失败 警告
    EM_MT_CREATE_FILE_FAILURE,      //创建文件失败 警告
    EM_MT_SET_DEFAULT_FILE_FAILURE, //设置默认程序失败 警告
    EM_MT_DELETE_FILE_FAILURE,      //删除文件失败 警告
    EM_MT_COPY_FILE_FAILURE,        //复制文件失败 警告
    EM_MT_CHANGE_FILE_PROPERTIES,   //更改文件属性 警告
    EM_MT_REGISTER_FAITUR,          //注册失败
    EM_MT_ONLINE_ID_CHECK_FAILURE, //联机检测有冲突 警告
    EM_MT_MAINTENANCE_DATE,        //保养日期提示 警告
    EM_MT_EZ_BACK_ZERO_ERROR,      //EZ回零失败
    EM_MT_EZ_RTC_ALARM1,    //上下轴电池电量过低请断电更换编码器电池！（此时不能操作其他界面和功能）
    EM_MT_EZ_RTC_ALARM2,    //摆臂轴电池电量过低请断电更换编码器电池！（此时不能操作其他界面和功能）
    EM_MT_EZ_RTC_ALARM3,    //前后轴电池电量过低请断电更换编码器电池！（此时不能操作其他界面和功能）
    EM_MT_EZ_RTC_ALARM4,    //旋转轴电池电量过低请断电更换编码器电池！（此时不能操作其他界面和功能）
    EM_MT_EZ_RTC_ALARM5,    //翻转轴电池电量过低请断电更换编码器电池！（此时不能操作其他界面和功能）
    EM_MT_EZ_RTC_ALARM6,    //第一轴电池电量过低请断电更换编码器电池！（此时不能操作其他界面和功能）
    EM_MT_RTC_ABSOLUTE_ENCODE_ERROR,   //绝对式编码器异常
    EM_MT_GUARDRASTER_EXPTION_MSG,     //光栅护栏异常
    EM_RTC_UNLOCK_FOREVER_POWER_DOWN,  //永久解锁状态下电池掉电
    EM_RTC_LOCK_POWER_DOWN,            //未解锁状态下，电池掉电

#ifdef STM32
#else
    EM_MT_RST_PFAIL,
    EM_MT_LOW_BATTERY,
    EM_MT_OVER_TCMD,
    EM_MT_OVER_VCMD,
    EM_MT_OVER_LOAD,
    EM_MT_SETUP,
    EM_MT_UD_VTG,
    EM_MT_EMG,
    EM_MT_LINE_UNREACHABLE,
    EM_MT_SINGULARITY,
#endif

    EM_MT_END
};

enum ENUM_DRIVER_STATUS
{
    EM_DRIVER_STANDBY,
    EM_DRIVER_UNSTANDBY,
    EM_DRIVER_WARNING,
    EM_DRIVER_OFFSET_ERROR,
    EM_DRIVER_END
};

enum ENUM_EMERGENCY_STATUS
{
    EM_EMERGENCY_RELEASED,
    EM_EMERGENCY_PRESSED,
    EM_EMERGENCY_END
};

enum STACK_UP_DOWN_TYPE
{
    EM_STACK_PALLET,
    EM_STACK_DEPALLET,
    EM_STACK_PALLET_END
};

enum STACK_ORDER_TYPE
{
    EM_ORDER_RCL,
    EM_ORDER_CRL,
    EM_STACK_ORDER_END
};

enum STACK_AUX_TYPE
{
    EM_STACK_AUX_NONE,
    EM_STACK_AUX_EXIST,   
    EM_STACK_AUX_END
};


enum EM_PALLET_MODE
{
    EM_PALLET_MODE_B = 0,
    EM_PALLET_MODE_BX = 1,
    EM_PALLET_MODE_E = 2,
    EM_PALLET_MODE_EX = 3
};

enum EM_PALLET_PATH_TYPE
{
    EM_PALLET_PATH_APPROACH = 0,
    EM_PALLET_PATH_FLEE = 1,
    EM_PALLET_PATH_STACK = 2
};

enum EM_PALLET_POINT_TYPE
{
    EM_PALLET_POINT_STACK = 0,
    EM_PALLET_POINT_APPROACH = 1,
    EM_PALLET_POINT_FLEE = 2,
    EM_PALLET_POINT_STACKSTYLE = 3
};


/**motion type*/
/**
 * @brief The MOTION_FORMAT enum    运动指令
 */
enum MOTION_FORMAT{E_MOTION_J,E_MOTION_L,E_MOTION_C,E_MOTION_C2,E_MOTION_A};
enum FEED_RATE_FORMAT{E_RATE_PERCENT,E_RATE_MM_SEC,E_RATE_CM_MIN,E_RATE_INCH_MIN,E_RATE_DEG_SEC,E_RATE_SEC,E_RATE_MSEC};
enum POSITION_FORMAT {E_POSITION_P,E_POSITION_PR,E_POSITION_PAL_A,E_POSITION_PAL_R,E_POSITION_PAL_BTM,E_POSITION_DIRECT};
enum CNT_FORMAT {FINE,CNT};

enum SMOOTHING_FLAG{SMOOTHING_NONE,SMOOTHING_START,SMOOTHING_END};

enum CIRCLE_FLAG{CIRCLE_NONE,CIRCLE_START,CIRCLE_END};
//拓展新指令Fundation增加代码20191122hualei
enum INSTRUCTION_TYPE
{
   ERR=1,
    MOTION=2,
    WAIT=3,
    GOTO=4,
    JUMP=5,
   REG=6,
    IO=7,
    LABEL=8,
    RUN=9,
   SELECT=10,
    IF=11,
    CALL=12,
    FOR=13,
    ENDFOR=14,
   INS_PALLET=15,
    COORDINATE=16,
    ANOTATION=17,
    MOTION_SKIP=18,
    PAUSE=19,
   ABORT=20,
    END=21,
    UALM=22,
    MESSAGE=23,
    OVERRIDE=24,
   TIMER=25,
    RSR=26,
    GRIPPER=27,
    MODBUS_START=28,
    MODBUS_READ=29,
   MODBUS_WRITE=30,
    MOVE_MAG=31,
    MOVE_FREE=32,
    TCP_START=33,
    TCP_READ=34,
   TCP_WRITE=35,
    MUSIC=36,
    SET_ODOM=37,
    CHARGING,LIFT=39,
   LOAD_MAP=40,
    CHECK_BATTERY=41,
    WAIT_COMAND=42,
    ROBOT_MOVE=43,
    ROLLER=44,
   INS_VISION_RUN=45,
    INS_VISION_TRIGGER=46,
    INS_VISION_GET_DATA=47,
    INS_VISION_CLEAR_DATA=48,
    INS_TRACK_START=49,
   INS_TRACK_END=50,
    INS_TRACK_GET_DATA=51,
    INS_AXIS_MOVE=52,
    INS_REG_PR=53,
    INS_REG_PL=54,
   INS_WELD_START=55,
    INS_WELD_END=56,
    INS_WEAVE=57,
    INS_WEAVE_END=58,
    INS_TRACKWELD_TAST=59,
   INS_TRACKWELD_END=60,
    INS_WATCHDI=61,
    INS_LASER_CAMERA_FETCHPOINT=62,
    INS_LASER_CAMERA_CTRL=63,
    INS_LASER_CAMERA_TRACK=64,
    INS_LASER_SCAN=65,
    INS_BUFFER_MOVE=66,
    INS_GCODE=67,
    INS_MCODE=68,

};

enum E_GCODE_TYPE
{
    E_GCODE_NONE,
    E_GCODE_G00,//快速定位
    E_GCODE_G01,//直线进给
    E_GCODE_G02,//直线进给
    E_GCODE_G03,//直线进给
    E_GCODE_G04,//暂停　G4 P0.3
    E_GCODE_M3,//主轴正转
    E_GCODE_M4,//主轴反转
    E_GCODE_M5,//主轴停止
    E_GCODE_ERROR,
};

enum E_BUTTON_COMMAND_TYPE
{
    EB_MOVE_J=0,
    EB_MOVE_L=1,
    EB_MOVE_C=2,
    EB_LABEL=3,
    EB_JUMP=4,
    EB_CONDITION=5,
    EB_WAIT=6,
    EB_DO=7,
    EB_AO=8,
    EB_MOVEMAG=9,
    EB_MOVEFREE=10,
    EB_SET_ODOM=11,
    EB_CHECK_BATTERY=12,
    EB_WAIT_EXT_COMMAND=13,
    EB_ROBOT_MOVE=14,
    EB_ROLLER=15,
    EB_MUSIC=16,
    EB_LOAD_MAP=17,
    EB_CHARGE=18,
    EB_LIFT=19,
    EB_AXIS_MOVE=20,
    EB_R_REGISTER=21,
    EB_PR_REGISTER=22,
    EB_PL_REGISTER=23,
    EB_TIMER_REGISTER=24,

};

enum E_MODBUS_SPEC_TYPE
{
    E_MODBUS_SPEC_TYPE_RS485_MASTER,
    E_MODBUS_SPEC_TYPE_RS485_SLAVE,
    E_MODBUS_SPEC_TYPE_INTERNET_MASTER,
    E_MODBUS_SPEC_TYPE_INTERNET_SLAVE,
    E_MODBUS_SPEC_TYPE_ERROR
};

/**
 * @brief The E_MOVE_MAG_LMR_DIRECTION enum   MOVE_MAG　指令左中右方向移动类型
 */
enum E_MOVE_MAG_LMR_TYPE
{
    E_MOVE_MAG_LEFT_DIRECTION,          // 往左移动
    E_MOVE_MAG_MIDDLE_DIRECTION,        // 往中间移动
    E_MOVE_MAG_RIGHT_DIRECTION          // 往右移动

};

/**
 * @brief The E_MOVE_MAG_FN_TYPE enum   MOVE_MAG 指令前后方向移动类型
 */
enum E_MOVE_MAG_FB_TYPE
{
    E_MOVE_MAG_FRONT_DIRECTION,         // 往前移动
    E_MOVE_MAG_BACK_DIRECTION           // 往后移动
};

enum E_MOVE_MAG_STOP_TYPE
{
    E_MOVE_MAG_NO_STOP,
    E_MOVE_MAG_RFID_STOP,
    E_MOVE_MAG_MAG_WIDTH_STOP,
    E_MOVE_MAG_INPUT_STOP

};

/**
 * @brief The E_MOVE_FREE_MODE enum     MOVE_FREE 指令导航模式类型
 */
enum E_MOVE_FREE_MODE
{
    E_MOVE_FREE_WHEEL,          // 轮子导航,不使用激光数据纠正
    E_MOVE_FREE_IMU,            // 陀螺仪惯性导航
    E_MOVE_FREE_LASER,          // 激光导航
};

enum E_MOVE_FREE_POINTS_ARRY_TYPE
{
    E_MOVE_FREE_POINTS_ARRY_DP,      // 单点运行，中间轨迹自由规划
    E_MOVE_FREE_POINTS_ARRY_DPR,     // 单寄存器点运行，中间轨迹自由规划
    E_MOVE_FREE_POINTS_ARRY_DPL      // 轨道运行，沿着一系列点形成的轨道运行

};

/**
 * @brief The E_MOVE_FREE_POINTS_MODE enum      自由导航点位模式 作废，重新定义到globaldefine.h
 */
//enum E_MOVE_FREE_POINTS_MODE
//{
//    E_MOVE_FREE_OP,             // 普通点
//    E_MOVE_FREE_QR,             // 二维码点
//    E_MOVE_FREE_VMARK,           // VMark点
//    E_MOVE_FREE_CU1,          // （2激光＋１视觉）点
//};

/**
 * @brief The ENUM_MOVE_FREE_MOVE_TRAJECTORY_TYPE enum         MOVE_FEE 自由导航指令运行轨迹类型
 */
enum ENUM_MOVE_FREE_MOVE_TRAJECTORY_TYPE //E_NAV_COMMAND相同
{
    E_MOVE_FREE_MOVE_TRAJECTORY_NONE=-1, //无轨迹
    E_MOVE_FREE_MOVE_TRAJECTORY_AUTO=0,       // 自由轨迹运行
    E_MOVE_FREE_MOVE_TRAJECTORY_LINE=1,       // 直线轨迹运行
    E_MOVE_FREE_MOVE_TRAJECTORY_SPLINE=2,      // 样条轨迹运行
    E_MOVE_FREE_MOVE_TRAJECTORY_ROTATE=3, //原地旋转

};

/**
 * @brief The EM_TCP_START_SERVER_CLIENT_TYPE enum          TCP 类型
 */
enum EM_TCP_BUSTYPE
{
    E_TCP_BUSTYPE_SERVER,             // 服务器端
    E_TCP_BUSTYPE_CLIENT              // 客户端
};

/**
 * @brief The EM_TCP_WRITE_BUS_TYPE enum     TCP接收总线类型
 */
enum EM_TCP_READ_BUS_TYPE
{
    E_TCP_READ_BUS_CLIENT,         // 客户端
    E_TCP_READ_BUS_SERVER          // 服务器端
};

/**
 * @brief The EM_TCP_WRITE_TYPE enum        tcp发送数据类型
 */
enum EM_TCP_WRITE_TYPE
{
    E_TCP_WRITE_TYPE_REGISTER,        // 发送寄存器数据
    E_TCP_WRITE_TYPE_CONST            // 发送常量
};

/**
 * @brief The EM_TCP_WRITE_BUS_TYPE enum    发送总线类型
 */
enum EM_TCP_WRITE_BUS_TYPE
{
    E_TCP_WRITE_BUS_CLIENT,         // 客户端
    E_TCP_WRITE_BUS_SERVER          // 服务器端
};

/**
 * @brief The EM_CHARGING_FINISH_TYPE enum      充电配置类型
 */
enum EM_CHARGING_FINISH_TYPE
{
    E_CHARGING_TIME,            // 充电时间
    E_CHARGING_CAPARITY,        // 充电容量
    E_CHARGING_FIRST_FINISHED,   // 取任一最先完成项
    E_CHARGING_ON,
    E_CHARGING_OFF,
};

///**
// * @brief The EM_MECHANISM_TYPE enum        升降机构类型
// */
//enum EM_MECHANISM_TYPE
//{
//    E_MECHANISM_GENERAL,        // 普通一般
//    E_MECHANISM_HEAVY,          // 重载
//    E_MECHANISM_ERROR
//};

/**
 * @brief The EM_LIFT_TYPE enum             升降类型
 */
enum EM_LIFT_TYPE
{
    E_LIFT_RISE,                // 上升
    E_LIFT_DOWN,               // 下降
    E_LIFT_RISE_MIDDLE,                // 上升中间
    E_LIFT_DOWN_MIDDLE,               // 下降中间

    E_LIFT_ERROR
};

/**
 * @brief The EM_TCP_START_SERVER_CLIENT_TYPE enum      TCP 总线类型
 */
enum EM_TCP_START_SERVER_CLIENT_TYPE
{
    E_TCP_START_SERVER,     // 服务器端
    E_TCP_START_CLIENT      // 客户端
};

//enum INSTRUCTION_TYPE {ERR,MOTION,JUMP,LABEL,IO,CALL,IF,SELECT,RUN,FOR,REG,};

/**program sub type*/
enum SUB_TYPE{NONE,JB,SUB_TYPE_PR,MR,COND};

/**register instruction type 寄存器指令*/
/**
 * @brief The REG_INS_TYPE enum 寄存器指令
 */
enum REG_INS_TYPE {REG_INS,POS_REG_INS,POS_REG_AXIS_INS,
                   AR_PAL_REG_INS,STR_REG,REG_GR};

enum VALUE_TYPE
{
    REG_AR,REG_CONST,REG_R,REG_PR,REG_GI,
    REG_GO,REG_AI,REG_AO,REG_DI,REG_DO,REG_RI,
    REG_RO,REG_SI,REG_SO,REG_UI,REG_UO,REG_TIMER,
    REG_TIMER_OVERFLOW,REG_P,REG_Lpos,REG_Jpos,
    REG_UFRAM,REG_UTOOL,REG_PL,REG_ADD,REG_DEC,
    REG_MUL,REG_DIVIVIDE,REG_MOD,REG_DIV,
    REG_LEFT_BRK,REG_RIGHT_BRK,REG_PL_CONST,REG_PR_IJ,
    CONST_DATA
};

/**IO指令*/
//enum IO_INS_TYPE {R_DI,DO_ON_OFF,DO_PULSE,DO_PULSE_WIDTH,DO_R,R_RI,RO_ON_OFF,RO_PULSE_WIDTH,RO_R,R_AI,AO,AO_R,R_GI,GO,GO_R};
/**
 * @brief The IO_INS_TYPE enum  IO指令
 */
enum IO_INS_TYPE {R_DI,DO_ON,DO_OFF,DO_PULSE_WIDTH ,DO_R ,R_RI ,RO_ON,RO_OFF ,RO_PULSE_WIDTH,RO_R,R_AI,AO_R,R_GI,GO_R,AO_CONST,GO_CONST};

//label,jump type
enum ADDRESSING_TYPE {DIRECT,INDIRECT,TYPE_NONE};

enum MOTION_OFFSET_TYPE{MOTION_OFFSET_NONEXIST,MOTION_OFFSET_PR,MOTION_OFFSET_PR_R};
enum MOTION_TOOL_OFFSET_TYPE{MOTION_TOOL_OFFSET_NONEXIST,MOTION_TOOL_OFFSET_PR,MOTION_TOOL_OFFSET_PR_R};
enum MOTION_WJNT_TYPE{MOTION_WJNT_NONEXIST,MOTION_WJNT_EXIST};
enum MOTION_INC_TYPE{MOTION_INC_NONEXIST,MOTION_INC_EXIST};
enum MOTION_PTH_TYPE{MOTION_PTH_NONEXIST,MOTION_PTH_EXIST};
enum MOTION_DI_TYPE{MOTION_DI_OFF,MOTION_DI_ON,MOTION_DI_NONE};

/**
 * @brief The IF_PROCESS_TYPE enum  if指令
 */
enum IF_PROCESS_TYPE{JMP,CALLING};
enum IF_AND_OR_TYPE{IF_AND,IF_OR,NEITHER};
enum IF_COND_TYPE {IF_R,IF_AO,IF_AI,IF_GO,IF_GI,IF_DO,IF_DI,IF_RO,IF_RI,IF_SO,IF_SI,IF_UO,IF_UI,IF_ON,IF_OFF,IF_CONST,IF_PL,IF_PL_IJK,IF_TIMER};
enum IF_OPERATOR_TYPE{GREATER,GREATER_EQU,EQU,SMALLER_EQU,SMALLER,NOT_EQU};

#define D_POSITIVE_ZERO 0.00000000001
#define D_NEGATIVE_ZERO -0.00000000001

/**
 * @brief The SELECT_JMP_CALL_TYPE enum     select
 */
enum SELECT_JMP_CALL_TYPE{SEL_JMP,SEL_CALL};
enum SELECT_VALUE_TYPE{CONSTANT,SEL_R};


/**
 * @brief The FOR_ACTION_TYPE enum  for、endfor指令
 */
enum FOR_ACTION_TYPE{TO,DOWNTO};
enum FOR_INITITAL_VALUE{INITIAL_CONST,FOR_R,FOR_AR};
enum FOR_TARGET_VALUE{TARGET_CONST,TARGET_R,TARGET_AR};

/**
 * @brief The PAL_TYPE enum     码垛指令
 */
enum PAL_TYPE{PAL_B,PAL_BX,PAL_E,PAL_EX,PAL_END};
//enum PAL_POSITION_FORMAT{PAL_A,PAL_R,PAL_BTM};
/**
 * @brief The COOR_TYPE enum    坐标系类型
 */
enum COOR_TYPE{UFRAME_TYPE,UTOOL_TYPE,UFRAME_PR_TYPE,UTOOL_PR_TYPE};

/**
 * @brief The WAIT_INS_TYPE enum    wait指令
 */
enum WAIT_INS_TYPE
{
    WAIT_DEAD,
    WAIT_R,
    WAIT_CONST_TIME,
    WAIT_R_R,WAIT_R_CONST,
    WAIT_AO_R,WAIT_AO_CONST,
    WAIT_AI_R,WAIT_AI_CONST,
    WAIT_GO_R,WAIT_GO_CONST,
    WAIT_GI_R,WAIT_GI_CONST,
    WAIT_DO_ON,WAIT_DO_OFF,WAIT_DO_DO,WAIT_DO_DI,WAIT_DO_RO,WAIT_DO_RI,WAIT_DO_SO,WAIT_DO_SI,WAIT_DO_UO,WAIT_DO_UI,WAIT_DO_R,
    WAIT_DI_ON,WAIT_DI_OFF,WAIT_DI_DO,WAIT_DI_DI,WAIT_DI_RO,WAIT_DI_RI,WAIT_DI_SO,WAIT_DI_SI,WAIT_DI_UO,WAIT_DI_UI,WAIT_DI_R,
    WAIT_RO_ON,WAIT_RO_OFF,WAIT_RO_DO,WAIT_RO_DI,WAIT_RO_RO,WAIT_RO_RI,WAIT_RO_SO,WAIT_RO_SI,WAIT_RO_UO,WAIT_RO_UI,WAIT_RO_R,
    WAIT_RI_ON,WAIT_RI_OFF,WAIT_RI_DO,WAIT_RI_DI,WAIT_RI_RO,WAIT_RI_RI,WAIT_RI_SO,WAIT_RI_SI,WAIT_RI_UO,WAIT_RI_UI,WAIT_RI_R,
    WAIT_SO_ON,WAIT_SO_OFF,WAIT_SO_DO,WAIT_SO_DI,WAIT_SO_RO,WAIT_SO_RI,WAIT_SO_SO,WAIT_SO_SI,WAIT_SO_UO,WAIT_SO_UI,WAIT_SO_R,
    WAIT_SI_ON,WAIT_SI_OFF,WAIT_SI_DO,WAIT_SI_DI,WAIT_SI_RO,WAIT_SI_RI,WAIT_SI_SO,WAIT_SI_SI,WAIT_SI_UO,WAIT_SI_UI,WAIT_SI_R,
    WAIT_UO_ON,WAIT_UO_OFF,WAIT_UO_DO,WAIT_UO_DI,WAIT_UO_RO,WAIT_UO_RI,WAIT_UO_SO,WAIT_UO_SI,WAIT_UO_UO,WAIT_UO_UI,WAIT_UO_R,
    WAIT_UI_ON,WAIT_UI_OFF,WAIT_UI_DO,WAIT_UI_DI,WAIT_UI_RO,WAIT_UI_RI,WAIT_UI_SO,WAIT_UI_SI,WAIT_UI_UO,WAIT_UI_UI,WAIT_UI_R,
    WAIT_GR_EQUAL_CONSTANT
};

enum WAIT_TIMEOUT_TIME_TYPE
{
    TIMEOUT_TIME_NONE,
    TIMEOUT_TIME_R,
    TIMEOUT_TIME_AR,
    TIMEOUT_TIME_END
};

enum WAIT_TIMEOUT_TYPE
{
    TIMEOUT_EXIST,
    TIMEOUT_NOT_EXIST,
    TIMEOUT_END
};

/**
 * @brief The EM_ROLLER_DIRECTION_TYPE enum     滚筒滚动方向类型
 */
enum EM_ROLLER_DIRECTION_TYPE
{
    E_ROLLER_LEFT_LOAD,      // 左边上货
    E_ROLLER_LEFT_DOWNLOAD,       // 左边卸货
    E_ROLLER_RIGHT_LOAD,      // 右边上货
    E_ROLLER_RIGHT_DOWNLOAD,       // 右边卸货
};

/**
 * @brief The EM_ROLLER_TYPE enum               滚筒机构类型
 */
//enum EM_ROLLER_TYPE
//{
//    E_ROLLER_GENERAL,        // 普通一般
//    E_ROLLER_HEAVY,          // 普通一般
//    E_ROLLER_ERROR
//};


/*****dailyrecord 程序*******/
enum DAILY_EVENT_TYPE{STAR,USR_ENTER,PROCESS,SYS,PUT_INTO_OPERATION,OPERATION,STOP,DIALY_TYPE_END};
enum DAILY_EVENT_CLASS{REMIND,WARN,FAULT,DAILY_CLASS_END};

enum OVERRIDE_VALUE_TYPE{OVERRIDE_VALUE_AR,OVERRIDE_VALUE_R,OVERRIDE_VALUE_CONST};
enum TIMER_PROCESS_TYPE{TIMER_PROCESS_STOP,TIMER_PROCESS_START,TIMER_PROCESS_RESET,TIMER_PROCESS_REG};
enum TIMER_VOER_FLOW_TYPE{TIMER_OVER_FLOW_NONE,TIMER_OVER_FLOW_YET};
enum RSR_TYPE{RSR_DISABLE,RSR_ENABLE};

//enum E_PATH_CONTROL_STRATEGY
//{
//    E_PATH_CONTROL_STRATEGY_DIFFERENTIAL=1,
//    E_PATH_CONTROL_STRATEGY_MCCRUM=2
//};



/**
 * @brief The EM_INSTRUCTION_TYPE enum　运动指令类型
 */
enum EM_INSTRUCTION_TYPE_NORMAL
{
    EM_INSTRUCTION_TYPE_J = 1,
    EM_INSTRUCTION_TYPE_L = 2,
    EM_INSTRUCTION_TYPE_C = 3,
    EM_INSTRUCTION_TYPE_C_2 = 4,
    EM_INSTRUCTION_TYPE_A = 5
};

enum EM_INSTRUCTION_TYPE_STAMP
{
    EM_INSTRUCTION_TYPE_F = 1,
    EM_INSTRUCTION_TYPE_FW = 2,
    EM_INSTRUCTION_TYPE_FT = 3,
    EM_INSTRUCTION_TYPE_FD = 4,
    EM_INSTRUCTION_TYPE_D = 5,
    EM_INSTRUCTION_TYPE_DW = 6,
    EM_INSTRUCTION_TYPE_DT = 7,
    EM_INSTRUCTION_TYPE_DD = 8
};

enum EM_INSTRUCTION_TYPE
{
    EM_INSTRUCTION_NORMAL,
    EM_INSTRUCTION_STAMP
};

//enum EM_RATE_UNIT
//{
//    EM_RATE_UNIT_PERCENT = 0,
//    EM_RATE_UNIT_MM_SEC = 1,
//    EM_RATE_UNIT_CM_MIN = 2,
//    EM_RATE_UNIT_DEG_SEC = 3,
//    EM_RATE_UNIT_SEC = 4,
//    EM_RATE_UNIT_MSEC = 5,
//    EM_RATE_UNIT_INCH_MIN = 6
//};

//语言类型
enum LANGUAGE_TYPE
{
    ENUM_LAN_CHINESE,//中文
    ENUM_LAN_ENGLISH,//英文
    ENUM_LAN_END
};

#define D_ROBOT_AXIS_MAX 30
/**
 * @brief The EM_AXIS_UNIT enum             轴单位
 */
enum EM_AXIS_UNIT{
    EM_AXIS_DEG,
    EM_AXIS_MM
};

enum E_BUFFER_MOVE_TYPE
{
    E_BUFFER_MOVE_CONST,
    E_BUFFER_MOVE_ORI,
};
#endif // ENUM_H
